import { defineStore } from 'pinia'
import { ElMessage } from 'element-plus'

type TagsViewStoreState = {
    tagList: { name: string, path: string, isClick: boolean }[],
    everyTagList: { name: string, path: string, isClick: boolean }[]
}

export const useTagsViewStore = defineStore('tagList', {
    state(): TagsViewStoreState {
        return {
            tagList: [],
            everyTagList: []
        }
    },
    actions: {
        ChangeIsClick() {

        },
        PushOneTag(val: string, path: string) {
            const repeat = this.tagList.some(item => item.name === val)
            if (!repeat) {
                this.tagList.push({ name: val, path, isClick: true })
            }


        }
    }
})